import React from "react";
import Draw from "./draw";
import { onmousedown } from "./event";
class CanvasComp extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            elementList: [],
        };
    }
    componentDidMount() {
        console.log("开始绘制canvas");

        const element = new Draw("canvas");
        element.drawBg();
        element.drawCircle(100, 100, 50);

        // element.drawRect(50, 50, 100, 100);


        // canvas.onmousedown = onmousedown;
    }

    render() {
        return <canvas id="canvas" width="800" height="800"></canvas>;
    }
}

export default CanvasComp;
